package com.jbm.onehome.iface;

import com.jbm.core.iface.IAcross;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;

/**
 * Created by lyh on 2017-04-28.
 */
@Entity
@Table(name = "v_eguard_log", schema = "", catalog = "")
public class VEguardLogEntity extends IAcross implements Serializable
{
	public VEguardLogEntity()
	{
		super();
	}

	public VEguardLogEntity(IAcross ia)
	{
		super(ia);
	}

    private static final long serialVersionUID = -4719517756832087918L;
    private String name;
    private String address;
    private Timestamp openDate;
    private Timestamp createDate;
    private Integer isOpen;
    private Integer tryCnt;
    private String phoneModule;
    private String openType;
    private String errinfo;

    @Id
    @Basic
    @Column(name = "name", nullable = true,  updatable = true, length = 20)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "address", nullable = true,  updatable = true, length = 2000)
    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Basic
    @Column(name = "open_date")
    public Timestamp getOpenDate() {
        return openDate;
    }

    public void setOpenDate(Timestamp openDate) {
        this.openDate = openDate;
    }

    @Id
    @Basic
    @Column(name = "create_date", nullable = true,  updatable = true)
    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }

    @Basic
    @Column(name = "is_open", nullable = true,  updatable = true)
    public Integer getIsOpen() {
        return isOpen;
    }

    public void setIsOpen(Integer isOpen) {
        this.isOpen = isOpen;
    }

    @Basic
    @Column(name = "try_cnt", nullable = true,  updatable = true)
    public Integer getTryCnt() {
        return tryCnt;
    }

    public void setTryCnt(Integer tryCnt) {
        this.tryCnt = tryCnt;
    }

    @Basic
    @Column(name = "phone_module", nullable = true,  updatable = true, length = 100)
    public String getPhoneModule() {
        return phoneModule;
    }

    public void setPhoneModule(String phoneModule) {
        this.phoneModule = phoneModule;
    }

    @Basic
    @Column(name = "open_type", nullable = true,  updatable = true, length = 20)
    public String getOpenType() {
        return openType;
    }

    public void setOpenType(String openType) {
        this.openType = openType;
    }

    @Basic
    @Column(name = "errinfo", nullable = true,  updatable = true, length = 100)
    public String getErrinfo() {
        return errinfo;
    }

    public void setErrinfo(String errinfo) {
        this.errinfo = errinfo;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        VEguardLogEntity that = (VEguardLogEntity) o;

        if (address != null ? !address.equals(that.address) : that.address != null) return false;
        if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
        if (errinfo != null ? !errinfo.equals(that.errinfo) : that.errinfo != null) return false;
        if (isOpen != null ? !isOpen.equals(that.isOpen) : that.isOpen != null) return false;
        if (name != null ? !name.equals(that.name) : that.name != null) return false;
        if (openDate != null ? !openDate.equals(that.openDate) : that.openDate != null) return false;
        if (openType != null ? !openType.equals(that.openType) : that.openType != null) return false;
        if (phoneModule != null ? !phoneModule.equals(that.phoneModule) : that.phoneModule != null) return false;
        if (tryCnt != null ? !tryCnt.equals(that.tryCnt) : that.tryCnt != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = name != null ? name.hashCode() : 0;
        result = 31 * result + (address != null ? address.hashCode() : 0);
        result = 31 * result + (openDate != null ? openDate.hashCode() : 0);
        result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
        result = 31 * result + (isOpen != null ? isOpen.hashCode() : 0);
        result = 31 * result + (tryCnt != null ? tryCnt.hashCode() : 0);
        result = 31 * result + (phoneModule != null ? phoneModule.hashCode() : 0);
        result = 31 * result + (openType != null ? openType.hashCode() : 0);
        result = 31 * result + (errinfo != null ? errinfo.hashCode() : 0);
        return result;
    }



    @Transient
    public String startDate;
    @Transient
    public String endDate;

    @Transient
    public boolean back;
    @Transient
    public String method;
    @Transient
    public String errorinfo;
    @Transient
    public int count;
    @Transient
    public int start=0;
    @Transient
    public int pagesize=0;
    @Transient
    public Integer tableid;
}
